package com.nuanshui.heatedloan.msgcenter.dal.mapper;

import com.nuanshui.heatedloan.msgcenter.form.MessageInfoForm;
import com.nuanshui.heatedloan.msgcenter.model.MessageInfo;
import com.nuanshui.heatedloan.msgcenter.model.UserMessage;
import com.nuanshui.heatedloan.msgcenter.vo.MessageInfoVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;

import java.util.List;


public interface MessageMapper {

    List<MessageInfo> selectByUserId(@Param(value = "userId") String userId, @Param("pager") Pageable pageable);

    void  insert(MessageInfoForm messageInfo);

    void  updateDeleted(MessageInfo messageInfo);

    void insertUserMessage(UserMessage userMessage);

    int selectCountByUserId(@Param(value = "userId") String userId);

    void updateUserMessageByUserId(@Param(value = "userId") String userId);

    List<MessageInfoVO> selectByUserIdAndType(@Param(value = "userIds") List<String> userIds, @Param("isRead") Integer isRead, @Param("currentUserId") String currentUserId, @Param("typelist") List<String> typelist, @Param("pager") Pageable pageable);

    List<MessageInfoVO> findFriendMessage(@Param(value = "userIds") List<String> userIds, @Param("currentUserId") String currentUserId, @Param("typelist") List<String> typelist, @Param("pager") Pageable pageable);

    List<MessageInfoVO> loadUserMaintainMsg(@Param(value = "userId") String userId, @Param(value = "pager") Pageable pager);

}
